"use client";
import React from "react";
import {ActionIcon, Tooltip} from "@mantine/core";
import {IconArrowsMaximize, IconArrowsMinimize} from "@tabler/icons-react";

interface IpdGraphFullscreenProps {
  fullscreen: boolean;
  toggle: () => void;
}

export const IpdGraphFullscreen: React.FC<IpdGraphFullscreenProps> = ({fullscreen, toggle}) => {
  return (
    <Tooltip
      label={fullscreen ? "取消全屏" : "全屏"}
      withArrow
      position="bottom"
      transitionProps={{transition: "fade", duration: 300}}
    >
      <ActionIcon variant="default" onClick={toggle}>
        {fullscreen ? (
          <IconArrowsMinimize size={16} stroke={1.5} />
        ) : (
          <IconArrowsMaximize size={16} stroke={1.5} />
        )}
      </ActionIcon>
    </Tooltip>
  );
};
